﻿<UserControl x:Class="BP.SignControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" >
    
    <Grid x:Name="LayoutRoot" Background="LightGray">
    	<!--<TextBlock x:Name="txtTitle" Text="InkPresenter 演 示" FontWeight="Bold" Grid.Row="0" HorizontalAlignment="Center" Height="20" VerticalAlignment="Center" Foreground="White" />-->

    	<StackPanel x:Name="spToolBar" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,26,0,0" d:LayoutOverrides="GridBox" Height="25" VerticalAlignment="Top" Visibility="Collapsed">
    		<TextBlock Text="笔划颜色：" VerticalAlignment="Center"/>
    		<ComboBox x:Name="cboColor" Width="65" VerticalAlignment="Center">
    			<ComboBox.ItemTemplate>
    				<DataTemplate>
    					<StackPanel Orientation="Horizontal">
    						<Rectangle Fill="{Binding Color}" ToolTipService.ToolTip="{Binding Name}" Width="10" Height="10"/>
    						<TextBlock Text="{Binding Name}" Margin="2,0,0,0" Foreground="{Binding Color}"/>
    					</StackPanel>
    				</DataTemplate>
    			</ComboBox.ItemTemplate>
    		</ComboBox>
    		<TextBlock Text="笔划外框颜色：" VerticalAlignment="Center" Margin="10,0,0,0"/>
    		<ComboBox x:Name="cboOutlineColor" Width="65" VerticalAlignment="Center">
    			<ComboBox.ItemTemplate>
    				<DataTemplate>
    					<StackPanel Orientation="Horizontal">
    						<Rectangle Fill="{Binding Color}" ToolTipService.ToolTip="{Binding Name}" Width="10" Height="10"/>
    						<TextBlock Text="{Binding Name}" Margin="2,0,0,0" Foreground="{Binding Color}"/>
    					</StackPanel>
    				</DataTemplate>
    			</ComboBox.ItemTemplate>
    		</ComboBox>
    		<TextBlock Text="笔划宽度：" Margin="10,0,0,0" VerticalAlignment="Center"/>
    		<ComboBox x:Name="cboWidth" Width="60" VerticalAlignment="Center" Height="20">
    			<ComboBox.ItemTemplate>
    				<DataTemplate>
    					<Rectangle Fill="Black" Width="40" Height="{Binding Size}"/>
    				</DataTemplate>
    			</ComboBox.ItemTemplate>
    		</ComboBox>
    		<TextBlock Text="笔划高度：" Margin="10,0,0,0" VerticalAlignment="Center"/>
    		<ComboBox x:Name="cboHeight" Width="60" VerticalAlignment="Center" Height="20">
    			<ComboBox.ItemTemplate>
    				<DataTemplate>
    					<Rectangle Fill="Black" Width="40" Height="{Binding Size}"/>
    				</DataTemplate>
    			</ComboBox.ItemTemplate>
    		</ComboBox>
    		<TextBlock Text="透明度：" Margin="10,0,0,0" VerticalAlignment="Center"/>
    		<ComboBox x:Name="cboOpactiy" Width="60" VerticalAlignment="Center" SelectionChanged="cboOpactiy_SelectionChanged">
    			<ComboBox.ItemTemplate>
    				<DataTemplate>
    					<StackPanel Orientation="Horizontal">
    						<TextBlock Text="{Binding Value}" Opacity="{Binding Value}" />
    					</StackPanel>
    				</DataTemplate>
    			</ComboBox.ItemTemplate>
    		</ComboBox>
    	</StackPanel>


        <Grid x:Name="inkC" Background="LightGray" Margin="2" >
    		<Rectangle x:Name="rectBg" Grid.Row="2"  Fill="White"  Margin="0" StrokeThickness="0"/>
    		<!--<Image Source="background2.png" Stretch="UniformToFill" x:Name="imgBg" Visibility="Collapsed"/>-->
    		<InkPresenter x:Name="ink" Background="Transparent" Opacity="1" 
    			MouseLeftButtonDown="OnMouseLeftButtonDown"
    			MouseMove="OnMouseMove"
    			LostMouseCapture="OnLostMouseCapture">
    			<InkPresenter.Clip>
                    <RectangleGeometry x:Name="rg" Rect="0,0,650,370"/>
    			</InkPresenter.Clip>
                
            </InkPresenter>
        </Grid>


    	<StackPanel x:Name="spBtn" Margin="0,0,0,153" Orientation="Horizontal" HorizontalAlignment="Center" d:LayoutOverrides="GridBox" Height="30" VerticalAlignment="Bottom" Visibility="Collapsed">
    		<Button x:Name="btnToogleBg"  HorizontalAlignment="Center"  Width="80" Content="隐藏背景图" VerticalAlignment="Center" Click="btnToogleBg_Click"/>
    		<Button x:Name="btnToogleBgRect"  HorizontalAlignment="Center"  Width="80" Content="隐藏背景色" VerticalAlignment="Center" Click="btnToogleBgRect_Click" Margin="10,0,0,0"/>
    		<Button x:Name="btnSaveLocal"  HorizontalAlignment="Center"  Width="90" Content="保存图片到本地" VerticalAlignment="Center" Margin="10,0,0,0" Click="btnSaveLocal_Click" />
    		
    		<Button x:Name="btnClearSave"  HorizontalAlignment="Center"  Width="80" Content="清空保存区" VerticalAlignment="Center" Margin="10,0,0,0" Click="btnClearSave_Click"/>
    	</StackPanel>

    	<ScrollViewer x:Name="ScreenshotViewer" Margin="0" Background="#FFFFFF99" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" Height="150" VerticalAlignment="Bottom" Visibility="Collapsed">
    		<StackPanel x:Name="thumbs"  Orientation="Horizontal"/>
    	</ScrollViewer>
    	<Button x:Name="btnSave"  HorizontalAlignment="Right"  Width="40" Content="保存" VerticalAlignment="Bottom" Click="btnSave_Click"  />
        <Button x:Name="btnClear" Width="40" Content="清空" Click="btnClear_Click" Height="22" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,45,0"  />
    </Grid>
</UserControl>
